﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Shapes;

namespace WP8.VisualStates.Controls
{
    public class MiControl : Control
    {
        Rectangle rec;
        Button btn;

        public override void OnApplyTemplate()
        {
            rec = this.GetTemplateChild("unicornioRosa") as Rectangle;
            btn = this.GetTemplateChild("btn") as Button;

            btn.Click += btn_Click;

            base.OnApplyTemplate();
        }

        private void btn_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            VisualStateManager.GoToState(this, "LeftButton", false);
        }
    }
}
